from celery import Celery

import os
if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'meiduo_mall.settings.dev'

celery_app = Celery('meiduo')
# 将 config 配置给celery
# 参数为创建的config 配置文件
# celery -A celery_tasks.main worker --pool=solo -l info
celery_app.config_from_object('celery_tasks.config')
celery_app.autodiscover_tasks(['celery_tasks.sms', 'celery_tasks.email'])

